package com.airlines.crewassignment.service.linkline.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.airlines.base.service.base.impl.BaseServiceImpl;
import com.airlines.crewassignment.dao.linkline.TaskLoopDayMapper;
import com.airlines.crewassignment.entity.linkline.TaskLoopDay;
import com.airlines.crewassignment.service.linkline.TaskLoopDayService;

/**
 * @author xxxx
 * @date 2018年6月9日 
 * @description
 */
@Service
public class TaskLoopDayServiceImpl extends BaseServiceImpl<TaskLoopDay, Integer> implements TaskLoopDayService{
	@Autowired
	private TaskLoopDayMapper taskLoopDayMapper;
	
	@Autowired
	@Override
	public void setBaseMapper() {
		super.setBaseMapper(taskLoopDayMapper);
	}

	@Override
	public List<TaskLoopDay> listTaskLoopDayByLoopId(int loopId) {
		TaskLoopDay dayQuery = new TaskLoopDay();
		dayQuery.setLoopId(loopId);
		return  this.listData(dayQuery);
	}

	@Override
	public int saveOrUpdate(TaskLoopDay taskLoopDay) {
		if(taskLoopDay.getId() == null){
			return this.save(taskLoopDay);
		}else{
			return this.updateByPrimaryKeySelective(taskLoopDay);
		}
	}

}
